package com.cv.framework.operatelog.config;

import com.cv.framework.operatelog.core.aop.OperateLogAspect;
import com.cv.framework.operatelog.core.service.OperateLogFrameworkService;
import com.cv.framework.operatelog.core.service.OperateLogFrameworkServiceImpl;
import com.cv.system.api.logger.OperateLogApi;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;

/**
 * 操作日志自动配置类
 *
 * @author Charles_XDXD
 */
@AutoConfiguration
public class CvOperateLogAutoConfiguration {

    @DubboReference
    private OperateLogApi operateLogApi;

    @Bean
    public OperateLogAspect operateLogAspect() {
        return new OperateLogAspect();
    }

    @Bean
    public OperateLogFrameworkService operateLogFrameworkService(OperateLogApi operateLogApi) {
        return new OperateLogFrameworkServiceImpl(operateLogApi);
    }

}
